from manim import *
class SquareToCircle(Scene):    
    def construct(self):        
        circle = Circle()        
        circle.set_fill(PINK, opacity=0.5)        
        square = Square()  
        # 创建正方形        
        square.rotate(PI / 4)  
        # # 旋转正方形45°
        self.play(Create(square))  
        # 创建正方形的动画        
        self.play(Transform(square, circle))  
        # 变换为圆形        
        self.play(FadeOut(square)) 
        # 淡出正方形